//
//  MGoods.m
//  IOS-7day
//
//  Created by RIOS on 2018/5/1.
//  Copyright © 2018年 RIOS. All rights reserved.
//

#import "MGoods.h"

@implementation MGoods

- (instancetype)initWithDict:(NSDictionary *)dict{
    if (self = [super init]) {
        [self setValuesForKeysWithDictionary:dict];
    }
    
    return self;
}

+(instancetype)buildWithDict:(NSDictionary *)dict{
    return [[self alloc]initWithDict:dict];
}

+(NSMutableArray *)buildArray{
    NSString *path = [[NSBundle mainBundle]pathForResource:@"goods.plist" ofType:nil];
    NSArray *arrayDict = [NSArray arrayWithContentsOfFile:path];
    
    
    NSMutableArray *marray = [NSMutableArray new];
    
    for (NSDictionary *dict in arrayDict) {
        MGoods *goods = [self buildWithDict:dict];
        [marray addObject:goods];
        NSLog(@"goods:%@",goods);
    }
    
    
    return marray;
}

@end
